# $Id$
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: AeroNotix <aaron.l.france@gmail.com>
# Contributor: AeroNotix <aaron.l.france@gmail.com>

# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
#  - patch for AArch64 (https://github.com/rebar/rebar/pull/538)

pkgname=rebar
epoch=1
pkgver=2.6.0
pkgrel=1.1
pkgdesc="A sophisticated build-tool for Erlang projects that follows OTP principles."
arch=('any')
url="https://github.com/rebar/rebar"
license=('APACHE')
depends=('erlang-nox')
makedepends=('git')
source=("$pkgname-$pkgver.tar.gz::https://github.com/rebar/rebar/archive/$pkgver.tar.gz"
        'aarch64.patch')
md5sums=('20aea5eafe90f68accfe9487974ed0bf'
         '72bcc92fe06030bba13295bfc5578947')

prepare() {
  cd "$srcdir/rebar-$pkgver"
  patch -p1 -i ../aarch64.patch
}

build() {
  cd "$srcdir/rebar-$pkgver"
  make
}

package() {
  cd "$srcdir/rebar-$pkgver"
  install -Dm0755 "rebar" "$pkgdir/usr/bin/rebar"
  install -Dm0644 "priv/shell-completion/bash/rebar" "$pkgdir/usr/share/bash-completion/completions/rebar"
}
